<template>
	<view class="hexiao-container">
		<!-- 蓝色头部区域 -->
		<view class="blue-header">
			<view class="header-content">
				<view class="back-btn" @click="goBack">
					<uni-icons type="left" size="20" color="#fff"></uni-icons>
				</view>
				<text class="header-title">核销记录</text>
				<view class="header-right">
					<view class="header-right-container">
						<view class="header-icon">
							<text>⋯</text>
						</view>
						<view class="header-icon active">
							<view class="target-icon"></view>
						</view>
					</view>
				</view>
			</view>
		</view>
		
		<!-- 搜索栏 -->
		<view class="search-bar">
			<input class="search-input" v-model="searchText" placeholder="输入需要搜索的内容" />
			<image class="search-icon" src="/static/车联网服务商家端-03核销记录_slices/搜索@3x.png" mode="aspectFit"></image>
		</view>
		
		<!-- 记录列表 -->
		<scroll-view class="content-scroll" scroll-y>
			<view class="record-card" v-for="(item, index) in records" :key="index">
				<text class="service-type">{{ item.serviceType }}</text>
				<text class="record-item">下单用户:{{ item.user }}</text>
				<text class="record-item">实付金额:{{ item.amount }}</text>
				<text class="record-item time">核销时间:{{ item.time }}</text>
			</view>
		</scroll-view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				searchText: '',
				records: [
					{
						serviceType: '普通洗车、机油、工时',
						user: '张三',
						amount: '¥32.00',
						time: '2022-10-12 11:09'
					},
					{
						serviceType: '普通洗车、机油、工时',
						user: '张三',
						amount: '¥32.00',
						time: '2022-10-12 11:09'
					},
					{
						serviceType: '普通洗车、机油、工时',
						user: '张三',
						amount: '¥32.00',
						time: '2022-10-12 11:09'
					}
				]
			}
		},
		methods: {
			goBack() {
				uni.navigateBack()
			}
		}
	}
</script>

<style lang="scss" scoped>
	.hexiao-container {
		width: 100%;
		height: 100vh;
		background: #f5f5f5;
		display: flex;
		flex-direction: column;
	}
	
	.blue-header {
		background: #007aff;
		padding-top: var(--status-bar-height, 44px);
		padding-bottom: 20rpx;
	}
	
	.header-content {
		height: 88rpx;
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 0 30rpx;
		position: relative;
	}
	
	.back-btn {
		width: 60rpx;
		height: 60rpx;
		display: flex;
		align-items: center;
		justify-content: center;
	}
	
	.header-title {
		position: absolute;
		left: 50%;
		transform: translateX(-50%);
		font-size: 36rpx;
		font-weight: 500;
		color: #fff;
	}
	
	.header-right {
		display: flex;
		align-items: center;
	}
	
	.header-right-container {
		display: flex;
		align-items: center;
		background: rgba(255, 255, 255, 0.2);
		border-radius: 40rpx;
		padding: 8rpx 12rpx;
		gap: 8rpx;
	}
	
	.header-icon {
		width: 48rpx;
		height: 48rpx;
		display: flex;
		align-items: center;
		justify-content: center;
		border-radius: 50%;
		background: transparent;
		
		text {
			color: #fff;
			font-size: 32rpx;
			line-height: 1;
		}
		
		&.active {
			background: rgba(255, 255, 255, 0.3);
		}
	}
	
	.target-icon {
		width: 24rpx;
		height: 24rpx;
		border: 2rpx solid #fff;
		border-radius: 50%;
		position: relative;
		
		&::after {
			content: '';
			position: absolute;
			top: 50%;
			left: 50%;
			transform: translate(-50%, -50%);
			width: 8rpx;
			height: 8rpx;
			background: #fff;
			border-radius: 50%;
		}
	}
	
	.search-bar {
		background: #fff;
		margin: -20rpx 30rpx 20rpx 30rpx;
		border-radius: 16rpx;
		padding: 20rpx;
		display: flex;
		align-items: center;
		box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
		position: relative;
		z-index: 1;
	}
	
	.search-input {
		flex: 1;
		height: 60rpx;
		font-size: 28rpx;
		color: #333;
	}
	
	.search-input::placeholder {
		color: #999;
	}
	
	.search-icon {
		width: 40rpx;
		height: 40rpx;
		margin-left: 20rpx;
	}
	
	.content-scroll {
		flex: 1;
		overflow-y: auto;
		padding: 0 30rpx 40rpx 30rpx;
	}
	
	.record-card {
		background: #fff;
		border-radius: 16rpx;
		padding: 30rpx;
		margin-bottom: 20rpx;
		box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
	}
	
	.service-type {
		display: block;
		font-size: 30rpx;
		font-weight: 500;
		color: #333;
		margin-bottom: 20rpx;
	}
	
	.record-item {
		display: block;
		font-size: 26rpx;
		color: #666;
		margin-bottom: 12rpx;
		
		&.time {
			color: #999;
		}
	}
</style>

